import { createContext, useContext } from 'react'
import { InterAction } from '../store/countReducer'

export interface GlobalContextValue {
  color: string,
  count:number,
  switchTheme:(value:{color:string})=>void,
  dispatchCount:(action:InterAction)=>void
}
export const GlobalContext = createContext<GlobalContextValue>({
  color: 'red',
  count:0,
  switchTheme:(value)=>{},
  dispatchCount:(action)=>{}
})
export const useTableContext = () => useContext(GlobalContext)
export const GlobalContextProvider = GlobalContext.Provider
